package com.xiaoc.bulldozer.springboot.config.oss;

import com.xc.framework.common.oss.AliOSS;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Value("${oss.access.id}")
    private String accessID;

    @Value("${oss.access.key}")
    private String accessKey;

    @Value("${oss.bucket.name}")
    private String bucketName;

    @Value("${oss.endpoint}")
    private String endPoint;

    @Bean(name="aliOSS")
    public AliOSS aliOSS() throws Throwable {
        return new AliOSS(accessID, accessKey, bucketName, endPoint);
    }
}
